package com.jastar.android.game.richman.logic.Event;

import com.jastar.android.game.richman.GameActivity;
import com.jastar.android.game.richman.logic.bean.Cell;
import com.jastar.android.game.richman.logic.bean.Player;
import com.jastar.android.game.richman.logic.enums.CellType;
import com.jastar.android.util.Alert;

public class MoneyEvent extends Event {

    public int money;

    public MoneyEvent(String message, int weight, int money) {
        super(message, weight);
        this.money = money;
    }

    @Override
    public void hand(GameActivity activity, Cell cell, Player p, CellType.Callback callback) {
        Alert.info(activity, p.getIcon(), format(this.message, this.money), "确定", (d, w) -> {
            p.receive(this.money);
            callback.callback();
        });
    }

}
